package org.senseframework.support.orm.hbase.query;

import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.hbase.util.Bytes;

/**
 * @author wangqian
 * @date 18/4/12 下午9:01
 */
public class Update {

    private byte[] family;
    private byte[] qualifier;
    private byte[] value;

    public Update(String family, String qualifier, byte[] value) {
        if (StringUtils.isNotBlank(family)) {
            this.family = Bytes.toBytes(family);
        }
        if (StringUtils.isNotBlank(qualifier)) {
            this.qualifier = Bytes.toBytes(qualifier);
        }
        if (value != null) {
            this.value = value;
        }
    }

    public byte[] getFamily() {
        return family;
    }

    public void setFamily(byte[] family) {
        this.family = family;
    }

    public byte[] getQualifier() {
        return qualifier;
    }

    public void setQualifier(byte[] qualifier) {
        this.qualifier = qualifier;
    }

    public byte[] getValue() {
        return value;
    }

    public void setValue(byte[] value) {
        this.value = value;
    }
}
